package com.lee.lease.common.threadlocal;

import org.springframework.stereotype.Component;

/**
 * ClassName: MyThreadLocal
 * Package: com.lee.lease.common.util
 * Description:
 */
@Component
public class LoginUserContext{
    private static final ThreadLocal<LoginUser> userThreadLocal = new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser){
        userThreadLocal.set(loginUser);
    }
    public static LoginUser getLoginUser(){
        return userThreadLocal.get();
    }
    public static void clear(){
        userThreadLocal.remove();
    }


}
